package json_object_mapper.request_rpc_objects;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import org.webrtc.SessionDescription;

import json_object_mapper.SDPTypeDeserializer;

public class SessionDescriptionSerializer {
    private String sdp;

    @JsonDeserialize(using=SDPTypeDeserializer.class)
    private SessionDescription.Type type;

    public SessionDescriptionSerializer() {

    }

    public SessionDescriptionSerializer(SessionDescription.Type type, String sdp) {
        this.type = type;
        this.sdp = sdp;
    }

    public String getSdp() {
        return sdp;
    }

    public SessionDescription.Type getType() {
        return type;
    }

    public SessionDescription getAsSessionDescription() {
        return new SessionDescription(type, sdp);
    }

}
